package com.spi.soconversion.jmsqueue;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;


public class SOCListableThread<T> {

		private final JMSQueueProcessor listable;

		public SOCListableThread(JMSQueueProcessor listable) {
			this.listable = listable;
		}

		private final FutureTask<Boolean> future = new FutureTask<Boolean>(
				new Callable<Boolean>() {

					public Boolean call() throws Exception {

						return listable.pushToQueue();
					}
				});

		private final Thread thread = new Thread(future);

		public void start() {
			thread.start();
		}

		public Boolean get() throws ExecutionException, InterruptedException  {
			return future.get();
		}
		
		public String getDirName()
		{
			return this.listable.getDirName();
		}
}
